package com.epcs.model.dto;
// Generated 11:42:59 01-02-2014 by Hibernate Tools 3.2.1.GA

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

/**
 * Account generated by hbm2java
 */
@Entity
@Table(name = "account", catalog = "epcs")
public class Account implements java.io.Serializable {

    private String username;
    private Role role;
    private String password;
    private String lastupdated;
    private String fullname;
    private Boolean isActive;
    private Set<Email> emails = new HashSet<Email>(0);
    private Set<Setting> settings = new HashSet<Setting>(0);
    private Set<Following> followings = new HashSet<Following>(0);
    private Set<Event> events = new HashSet<Event>(0);
    private Set<Comment> comments = new HashSet<Comment>(0);

    public Account() {
    }

    public Account(String username, String password) {
        this.username = username;
        this.password = password;
    }

    public Account(String username, Role role, String password, String lastupdated, String fullname, Boolean isActive, Set<Email> emails, Set<Setting> settings, Set<Following> followings, Set<Event> events, Set<Comment> comments) {
        this.username = username;
        this.role = role;
        this.password = password;
        this.lastupdated = lastupdated;
        this.fullname = fullname;
        this.isActive = isActive;
        this.emails = emails;
        this.settings = settings;
        this.followings = followings;
        this.events = events;
        this.comments = comments;
    }

    @Id
    @Column(name = "username", unique = true, nullable = false, length = 45)
    public String getUsername() {
        return this.username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @ManyToOne(fetch = FetchType.EAGER)
    @Cascade(org.hibernate.annotations.CascadeType.ALL)
    @JoinColumn(name = "roleID")
    public Role getRole() {
        return this.role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    @Column(name = "password", nullable = false, length = 20)
    public String getPassword() {
        return this.password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Column(name = "lastupdated", length = 45)
    public String getLastupdated() {
        return this.lastupdated;
    }

    public void setLastupdated(String lastupdated) {
        this.lastupdated = lastupdated;
    }

    @Column(name = "fullname", length = 60)
    public String getFullname() {
        return this.fullname;
    }

    public void setFullname(String fullname) {
        this.fullname = fullname;
    }

    @Column(name = "isActive")
    public Boolean getIsActive() {
        return this.isActive;
    }

    public void setIsActive(Boolean isActive) {
        this.isActive = isActive;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "account")
    public Set<Email> getEmails() {
        return this.emails;
    }

    public void setEmails(Set<Email> emails) {
        this.emails = emails;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "account")
    public Set<Setting> getSettings() {
        return this.settings;
    }

    public void setSettings(Set<Setting> settings) {
        this.settings = settings;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "account")
    public Set<Following> getFollowings() {
        return this.followings;
    }

    public void setFollowings(Set<Following> followings) {
        this.followings = followings;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "account")
    public Set<Event> getEvents() {
        return this.events;
    }

    public void setEvents(Set<Event> events) {
        this.events = events;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "account")
    public Set<Comment> getComments() {
        return this.comments;
    }

    public void setComments(Set<Comment> comments) {
        this.comments = comments;
    }
}
